package com.lsm.czxxgl_system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lsm.czxxgl_system.model.domain.Hljbxxb;
import com.lsm.czxxgl_system.service.HljbxxbService;
import com.lsm.czxxgl_system.mapper.HljbxxbMapper;
import org.springframework.stereotype.Service;

/**
 * @author shu
 * @description 针对表【hljbxxb】的数据库操作Service实现
 * @createDate 2024-06-27 20:05:29
 */
@Service
public class HljbxxbServiceImpl extends ServiceImpl<HljbxxbMapper, Hljbxxb>
        implements HljbxxbService {

    @Override
    public boolean updateRiver(Hljbxxb hljbxxb, String riverCodeOri) {
        //设置原始主键为查询条件
        QueryWrapper<Hljbxxb> hljbxxbQueryWrapper = new QueryWrapper<>();
        hljbxxbQueryWrapper.eq("river_code", riverCodeOri);
        //更新数据
        return this.update(hljbxxb, hljbxxbQueryWrapper);
    }

    @Override
    public Hljbxxb getByRiverCode(String riverCode) {
        //设置河流编码为查询条件
        QueryWrapper<Hljbxxb> hljbxxbQueryWrapper = new QueryWrapper<>();
        hljbxxbQueryWrapper.eq("river_code", riverCode);
        return this.getOne(hljbxxbQueryWrapper);
    }

    @Override
    public boolean removeByRiverCode(String riverCode) {
        //设置河流编码为查询条件
        QueryWrapper<Hljbxxb> hljbxxbQueryWrapper = new QueryWrapper<>();
        hljbxxbQueryWrapper.eq("river_code", riverCode);
        return this.remove(hljbxxbQueryWrapper);
    }
}




